<template>
	<view class="fbzw">
		<u-navbar bgColor="#fff">
			<view slot="left" class="align-center">
				<image @click="$tools.back()" src="@/static/login/back3.png" style="width: 36rpx; height: 36rpx">
				</image>
			</view>
			<view slot="center">
				<view style="font-weight: 600; font-size: 36rpx; color: #333333">发布职位</view>
			</view>
		</u-navbar>
		<view style="margin-bottom: 50rpx" v-if="current != 3">
			<u-steps :current="current" activeColor="#1365F9" inactiveColor="rgba(19, 101, 249, 0.4)">
				<u-steps-item title="基本信息"></u-steps-item>
				<u-steps-item title="职位要求"></u-steps-item>
				<u-steps-item title="确认信息"></u-steps-item>
			</u-steps>
		</view>
		<view style="padding: 0 32rpx">
			<view v-if="current == 0">
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*招聘项目名称</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input type="text" v-model="form.companyName" placeholder="请输入" class="label1" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*招聘工种名称</view>
					<view @click="$tools.navigite('/pages/index/postjob', 2)" class="flex-between1"
						style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<text class="label1">{{ form.jobName }}</text>
						<image src="@/static/mine/mineright.png" style="width: 16rpx; height: 26rpx"></image>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*联系人</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input class="label1" v-model="form.contacts" type="text" placeholder="请输入" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*联系电话</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input class="label1" v-model="form.phone" type="number" placeholder="请输入" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*招聘人数</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input class="label1" v-model="form.total" maxlength="5" type="number" placeholder="请输入" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*招聘类型</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<view class="btn1" :class="{ btn2: form.workType == 1 }" @click="form.workType = 1">长期</view>
						<view class="btn1" :class="{ btn2: form.workType == 2 }" @click="form.workType = 2">临时工</view>
						<view class="btn1" :class="{ btn2: form.workType == 3 }" @click="form.workType = 3">小时工</view>
						<view class="btn1" :class="{ btn2: form.workType == 4 }" @click="form.workType = 4">计件工</view>
						<view class="btn1" :class="{ btn2: form.workType == 5 }" @click="form.workType = 5">其他</view>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*工作地址</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<text class="label1">{{ form.address }}</text>
						<image src="@/static/mine/mineright.png" style="width: 16rpx; height: 26rpx"
							@click="getaddress()"></image>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*工作时间</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input type="text" v-model="form.jobTime" placeholder="请输入" class="label1" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*薪资范围</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<view class="btn1" :class="{ btn2: form.salaryType == 1 }" @click="form.salaryType = 1">元/小时
						</view>
						<view class="btn1" :class="{ btn2: form.salaryType == 2 }" @click="form.salaryType = 2">元/天
						</view>
						<view class="btn1" :class="{ btn2: form.salaryType == 3 }" @click="form.salaryType = 3">元/月
						</view>
					</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input type="number" v-model="form.salaryStart" maxlength="6" placeholder="请输入"
							style="text-align: center" />
						<text>-</text>
						<input type="number" v-model="form.salaryEnd" maxlength="6" placeholder="请输入"
							style="text-align: center" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*结算方式</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<view class="btn1" :class="{ btn2: form.settleType == 1 }" @click="form.settleType = 1">日结
						</view>
						<view class="btn1" :class="{ btn2: form.settleType == 2 }" @click="form.settleType = 2">周结
						</view>
						<view class="btn1" :class="{ btn2: form.settleType == 3 }" @click="form.settleType = 3">月结
						</view>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view style="font-weight: 300; font-size: 24rpx; color: #333333">*上传公司资质</view>
					<view style="font-weight: 400; font-size: 28rpx; color: #999999">可上传酒店封面、现场环境图片、视频等等</view>
					<view class="flex-between" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<u-upload :fileList="fileList1" accept="all" @afterRead="afterRead" @delete="deletePic" name="1"
							multiple :maxCount="10" width="200" height="200" uploadIcon="plus"></u-upload>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*是否上社保</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<view class="btn1" :class="{ btn2: form.isSocial === 1 }" @click="form.isSocial = 1">是</view>
						<view class="btn1" :class="{ btn2: form.isSocial === 0 }" @click="form.isSocial = 0">否</view>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">自定义</view>
					<view style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<view class="flex-between1" style="margin-bottom: 20rpx">
							<input type="text" v-model="labels" placeholder="请输入6个字以内" style="
                  font-weight: 400;
                  font-size: 28rpx;
                  color: #aaaaaa;
                  padding: 16rpx 22rpx;
                  width: 500rpx;
                  background: #f5f6fa;
                  border-radius: 8rpx;
                " />
							<view @click="clickAdd()" class="flex-center1" style="
                  width: 124rpx;
                  height: 72rpx;
                  background: #1365f9;
                  border-radius: 8rpx;
                  font-weight: 600;
                  font-size: 28rpx;
                  color: #ffffff;
                ">
								添加
							</view>
						</view>
						<view class="flex-wrap">
							<view class="flex-center1" @click="labellist.splice(index, 1)"
								v-for="(item, index) in labellist" :key="index" style="
                  margin: 0 20rpx 20rpx 0;
                  width: 202rpx;
                  height: 76rpx;
                  background: rgba(19, 101, 249, 0.1);
                  border-radius: 8rpx;
                  font-size: 28rpx;
                  color: #1365f9;
                ">
								{{ item }}
							</view>
						</view>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*是否允许其他服务商上人</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<view class="btn1" :class="{ btn2: form.isOut === 1 }" @click="form.isOut = 1">是</view>
						<view class="btn1" :class="{ btn2: form.isOut === 0 }" @click="form.isOut = 0">否</view>
					</view>
				</view>
				<view v-if="form.isOut === 1" style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 80rpx">
					<view class="label">允许其他服务商上人数量</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input class="label1" v-model="form.outNum" type="number" placeholder="请输入" />
					</view>
				</view>
				<view class="flex-center1">
					<view @click="changeCurrent(0)" class="flex-center1 btn3">下一步</view>
				</view>
			</view>
			<view v-if="current == 1">
				<view @click="show1 = true" style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view style="font-weight: 300; font-size: 24rpx; color: #333333">*年龄</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<text style="font-size: 28rpx; color: #333333">{{ form.age }}</text>
						<image src="@/static/mine/mineright.png" style="width: 16rpx; height: 26rpx"></image>
					</view>
					<u-picker :show="show1" :columns="columns1" @confirm="confirm1" @cancel="show1 = false"></u-picker>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*工龄</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input type="text" v-model="form.workYear" placeholder="请输入" class="label1" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*工作经验</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input type="text" v-model="form.workExperience" placeholder="请输入" class="label1" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*性别</view>
					<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<view class="btn1" :class="{ btn2: form.sex === 0 }" @click="form.sex = 0">不限</view>
						<view class="btn1" :class="{ btn2: form.sex === 1 }" @click="form.sex = 1">男</view>
						<view class="btn1" :class="{ btn2: form.sex === 2 }" @click="form.sex = 2">女</view>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">*学历</view>
					<view class="" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<view class="flex" style="margin-bottom: 20rpx">
							<view class="btn1" :class="{ btn2: form.education == '不限' }" @click="form.education = '不限'">
								不限</view>
							<view class="btn1" :class="{ btn2: form.education == '高中以下' }"
								@click="form.education = '高中以下'">高中以下</view>
							<view class="btn1" :class="{ btn2: form.education == '中专/技校' }"
								@click="form.education = '中专/技校'">中专/技校</view>
							<view class="btn1" :class="{ btn2: form.education == '高中' }" @click="form.education = '高中'">
								高中</view>
						</view>
						<view class="flex">
							<view class="btn1" :class="{ btn2: form.education == '大专' }" @click="form.education = '大专'">
								大专</view>
							<view class="btn1" :class="{ btn2: form.education == '本科' }" @click="form.education = '本科'">
								本科</view>
						</view>
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">所学专业</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input type="text" v-model="form.major" placeholder="请输入" class="label1" />
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">身高</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input type="text" v-model="form.height" placeholder="请输入" class="label1" />
						cm
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<view class="label">体重</view>
					<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<input type="text" v-model="form.weight" placeholder="请输入" class="label1" />
						kg
					</view>
				</view>
				<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
					<!-- <view class="label">健康证</view>
					<view class="flex-between" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
						<u-upload
							:fileList="fileList2"
							@afterRead="afterRead"
							@delete="deletePic"
							name="2"
							multiple
							:maxCount="1"
							width="200"
							height="200"
							uploadIcon="plus"
						></u-upload>
					</view> -->
					<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
						<view class="label">健康证</view>
						<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
							<input type="text" v-model="form.healthCertificate" placeholder="请输入" class="label1" />
						</view>
					</view>
					<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
						<view class="label">个人形象</view>
						<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
							<input type="text" v-model="form.personalImage" placeholder="请输入" class="label1" />
						</view>
					</view>
					<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 80rpx">
						<view class="label">身体状况</view>
						<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
							<input type="text" v-model="form.physicalCondition" placeholder="请输入" class="label1" />
						</view>
					</view>
					<view style="border-bottom: 1rpx solid #eeeeee; margin-bottom: 80rpx">
						<view class="label">职位描述</view>
						<view class="flex-between1" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
							<textarea v-model="form.desc" placeholder="请输入" :maxlength="-1"></textarea>
						</view>
					</view>
					<view class="flex-between1">
						<view @click="current = 0" class="btn3 flex-center1" style="margin-right: 20rpx">上一步</view>
						<view @click="changeCurrent(1)" class="btn3 flex-center1">下一步</view>
					</view>
				</view>
			</view>
			<!--  -->
			<view v-if="current == 2">
				<!--  -->
				<view style="
            font-weight: 600;
            font-size: 32rpx;
            color: #333333;
            margin-bottom: 30rpx;
          ">基本信息</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">招聘公司</view>
					<view class="label1">{{ form.companyName }}</view>
				</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">招聘工种</view>
					<view class="label1">{{ form.jobName }}</view>
				</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">招聘类型</view>
					<view class="label1" v-if="form.workType == 1">长期</view>
					<view class="label1" v-if="form.workType == 2">临时工</view>
					<view class="label1" v-if="form.workType == 3">小时工</view>
					<view class="label1" v-if="form.workType == 4">计件工</view>
					<view class="label1" v-if="form.workType == 5">其他</view>
				</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">工作地址</view>
					<view class="label1">{{ form.address }}</view>
				</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">工作时间</view>
					<view class="label1">{{ form.jobTime }}</view>
				</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">薪酬范围</view>
					<view class="label1">{{ form.salaryStart }}-{{ form.salaryEnd }}</view>
				</view>
				<!--  -->
				<view style="
            font-weight: 600;
            font-size: 32rpx;
            color: #333333;
            margin-bottom: 30rpx;
          ">项目材料</view>
				<view class="flex" style="margin-bottom: 14rpx; padding: 10rpx 0 30rpx 0">
					<u-upload :fileList="fileList1" name="1" :deletable="false" multiple :maxCount="1" width="200"
						height="200" uploadIcon="plus"></u-upload>
				</view>
				<!--  -->
				<view style="
            font-weight: 600;
            font-size: 32rpx;
            color: #333333;
            margin-bottom: 30rpx;
          ">职位要求</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">年龄</view>
					<view class="label1">{{ form.age }}</view>
				</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">工龄</view>
					<view class="label1">{{ form.workYear }}</view>
				</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">性别</view>
					<view class="label1" v-if="form.sex === 1">男</view>
					<view class="label1" v-if="form.sex === 0">女</view>
				</view>
				<view class="flex-between1" style="margin-bottom: 30rpx">
					<view class="label">学历</view>
					<view class="label1">{{ form.education }}</view>
				</view>
				<!--  -->
				<view style="
            font-weight: 600;
            font-size: 32rpx;
            color: #333333;
            margin-bottom: 30rpx;
          ">职位描述</view>
				<view class="label1" v-html="form.desc.replace(/\n/g, '<br>')" style="margin-bottom: 80rpx"></view>
				<view class="flex-between1">
					<view @click="current = 1" class="btn3 flex-center1" style="margin-right: 20rpx">上一步</view>
					<view @click="changeCurrent(2)" class="btn3 flex-center1">发布职位</view>
				</view>
			</view>
			<view v-if="current == 3" style="padding: 100rpx">
				<view class="flex-center1" style="margin-bottom: 50rpx">
					<image src="@/static/fuwu/succ1.png" style="width: 400rpx; height: 418rpx"></image>
				</view>
				<view class="flex-center1" style="
            font-weight: 600;
            font-size: 32rpx;
            color: #242424;
            margin-bottom: 30rpx;
          ">发布成功</view>
				<view style="
            font-weight: 300;
            font-size: 28rpx;
            color: #666666;
            text-align: center;
          ">审核通过后劳动者将通过手机号联系您， 请注意接听</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				fileList1: [],
				fileList2: [],
				form: {
					companyName: '',
					jobName: '',
					jobType: '',
					contacts: '',
					phone: '',
					total: '',
					workType: '',
					address: '',
					dimension: '',
					longitude: '',
					jobTime: '',
					salaryType: '',
					salaryStart: '',
					salaryEnd: '',
					settleType: '',
					projectImg: '',
					isSocial: '',
					label: '',
					isOut: '',
					outNum: '',
					age: '',
					workYear: '',
					workExperience: '',
					sex: '',
					education: '',
					major: '',
					height: '',
					weight: '',
					healthCertificate: '',
					personalImage: '',
					physicalCondition: '',
					desc: ''
				},
				labels: '',
				labellist: [],
				id: '',
				show1: false,
				columns1: [
					['18岁', '19岁', '20岁', '21岁', '22岁', '23岁', '24岁', '25岁', '26岁', '27岁', '28岁', '29岁', '30岁', '31岁',
						'32岁', '33岁', '34岁', '35岁', '36岁', '37岁', '38岁', '39岁', '40岁', '41岁', '42岁', '43岁', '44岁',
						'45岁'
					],
					['18岁', '19岁', '20岁', '21岁', '22岁', '23岁', '24岁', '25岁', '26岁', '27岁', '28岁', '29岁', '30岁', '31岁',
						'32岁', '33岁', '34岁', '35岁', '36岁', '37岁', '38岁', '39岁', '40岁', '41岁', '42岁', '43岁', '44岁',
						'45岁'
					]
				]
			};
		},
		onLoad(option) {
			this.id = option.value;
			console.log(this.id);
			if (this.id != -1) {
				this.getdetail();
			}
		},
		methods: {
			clickAdd() {
				if (!this.labels) {
					uni.showToast({
						title: '请输入内容',
						duration: 2000,
						icon: "none"
					})
					return
				}
				if (this.labels.length > 6) {
					uni.showToast({
						title: '最多输入6个字',
						duration: 2000,
						icon: "none"
					})
					return;
				}
				this.labellist.push(this.labels);
				this.labels = '';
			},
			getdetail() {
				this.$request('front/user/postDetail', {
					id: this.id
				}).then((res) => {
					console.log(res, '详情');
					this.form = res.obj;
					this.form.statuss = '';
					if (this.form.projectImg) {
						const imglist = this.form.projectImg.split(',');
						imglist.map((item, index) => {
							this.$set(this.fileList1, index, {
								url: item
							});
						});
					}
				});
			},
			confirm1(e) {
				console.log('confirm', e);
				this.form.age = e.value[0] + '-' + e.value[1];
				this.show1 = false;
			},
			setimg(event, key) {
				const list = [];
				this[`fileList${event.name}`].map((item, index) => {
					list.push(item.url);
				});
				const fileList1str = list.join(',');
				if (event.name == 1) {
					this.form.projectImg = fileList1str;
					console.log(this.form.projectImg, 'image');
				}
				if (event.name == 2) {
					this.form.healthCertificate = fileList1str;
					console.log(this.form.healthCertificate, 'image');
				}
			},
			publishPost() {
				if (this.id == -1) {
					const data = this.form;
					data.label = this.labellist.join(',');
					this.$request('front/company/publishPost', data).then((res) => {
						if (res.code == 0) {
							this.current = 3;
							setTimeout(() => {
								this.$tools.back();
							}, 1500);
						}
					});
				} else {
					const data = this.form;
					data.label = this.labellist.join(',');
					data.id = this.id;
					this.$request('front/company/updatePost', data).then((res) => {
						if (res.code == 0) {
							this.current = 3;
							setTimeout(() => {
								this.$tools.back();
							}, 1500);
						}
					});
				}
			},

			changeCurrent(index) {
				if (index === 0) {
					if (!this.form.companyName) return this.$tools.toast('请输入招聘项目名称');
					if (!this.form.jobName) return this.$tools.toast('请输入招聘工种名称');
					if (!this.form.contacts) return this.$tools.toast('请输入联系人');
					if (!this.form.phone) return this.$tools.toast('请输入联系电话');
					if (!this.form.total) return this.$tools.toast('请输入招聘人数');
					if (!this.form.workType) return this.$tools.toast('请选择招聘类型');
					if (!this.form.address) return this.$tools.toast('请输入工作地点');
					if (!this.form.jobTime) return this.$tools.toast('请输入工作时间');
					if (!this.form.salaryType) return this.$tools.toast('请输入选择或输入薪资范围');
					if (!this.form.salaryStart) return this.$tools.toast('请输入选择或输入薪资范围');
					if (!this.form.salaryEnd) return this.$tools.toast('请选择或输入薪资范围');
					if (!this.form.settleType) return this.$tools.toast('请选择结算方式');
					if (!this.form.projectImg) return this.$tools.toast('请上传公司资质');
					if (this.form.isSocial === '') return this.$tools.toast('请选择是否上社保');
					if (this.form.isOut === '') return this.$tools.toast('请选择是否允许其他服务商上人');
					if (this.form.isOut && !this.form.outNum) return this.$tools.toast('请输入允许其他服务商上认数量');
					this.current = 1
				} else if (index === 1) {
					if (!this.form.age) return this.$tools.toast('请输入年龄');
					if (!this.form.workYear) return this.$tools.toast('请输入工龄');
					if (!this.form.sex) return this.$tools.toast('请选择性别');
					if (!this.form.education) return this.$tools.toast('请选择学历');
					this.current = 2
				} else {
					this.publishPost()
				}
			},
			async getaddress() {
				console.log("kkkk")
				const obj = await this.toCommunity();
				this.form.address = obj.address;
				console.log(obj, 'obj');
				console.log(this.form.address);
				this.form.dimension = obj.latitude;
				this.form.longitude = obj.longitude;
			},
			// 删除图片
			deletePic(event) {
				this[`fileList${event.name}`].splice(event.index, 1);
				this.setimg(event);
			},
			// 新增图片
			async afterRead(event) {
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file);
				let fileListLen = this[`fileList${event.name}`].length;
				lists.map(async (item) => {
					this[`fileList${event.name}`].push({
						...item,
						status: 'uploading',
						message: '上传中'
					});
					for (let i = 0; i < lists.length; i++) {
						const result = await this.uploadFilePromise(lists[i].url);
						let item = this[`fileList${event.name}`][fileListLen];
						this[`fileList${event.name}`].splice(
							fileListLen,
							1,
							Object.assign(item, {
								status: 'success',
								message: '',
								url: result
							})
						);
						fileListLen++;
					}

					this.setimg(event);
				})
			}
		}
	};
</script>

<style lang="less" scoped>
	::v-deep .u-text__value--main {
		span {
			font-weight: 600;
			font-size: 28rpx;
			color: #333333;
		}
	}

	::v-deep .u-text__value--content {
		span {
			font-size: 28rpx;
			color: #999999;
		}
	}

	.flex-between1 {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.fbzw {
		padding: 200rpx 0 100rpx;

		.label {
			font-weight: 300;
			font-size: 24rpx;
			color: #333333;
		}

		.label1 {
			font-size: 28rpx;
			color: #333333;
		}

		.btn1 {
			padding: 8rpx 20rpx;
			background: #f8f8f8;
			border-radius: 8rpx;
			font-weight: 400;
			font-size: 24rpx;
			color: #666666;
			margin-right: 20rpx;
		}

		.btn2 {
			background: #1365f9;
			font-weight: 600;
			color: #ffffff;
		}

		.btn3 {
			width: 640rpx;
			height: 96rpx;
			background: #1365f9;
			border-radius: 16rpx;
			font-weight: 600;
			font-size: 32rpx;
			color: #ffffff;
		}
	}
</style>